/*
 * ConsoleManager.h
 *
 *  Created on: Mar 5, 2012
 *      Author: mikaelgra
 */

#ifndef CONSOLEMANAGER_H_
#define CONSOLEMANAGER_H_

#include "ConsoleWorkItem.h"

/**
 * Initializes the ConsoleManager. This must be called before
 * any other methods on the ConsoleManager.
 */
void ConsoleManager_Initialize();

/**
 * Starts the ConsoleManager. This is a synchronous call
 * that wont return until the ConsoleManager has been stopped.
 */
void ConsoleManager_Start();

/**
 * Stops the ConsoleManager by ensuring that no more WorkItems
 * will be processed and that the thread responsible returns.
 */
void ConsoleManager_Stop();

/**
 * Finalizes the ConsoleManager stopping it, if necessary and
 * releasing all used resources.
 */
void ConsoleManager_Finalize();

/**
 * Interrupts the ConsoleManager with a workItem that must be processed
 * next. This will be called when an event happens on an alarm.
 *
 * @param workItem
 * 		This is the ConsoleWorkItem that represents the unit of work
 * 		that must be done at high priority.
 */
void ConsoleManager_InterruptWith(struct stConsoleWorkItem_t *workItem);

#endif /* CONSOLEMANAGER_H_ */
